<?php
class App_Tpl_Form_Field extends Mozg_Templator
{
    protected $error = false;

	protected function PreparePost($fieldData, $params)
	{
		return $fieldData;
	}

	protected function PrepareOut($fieldData, $params)
	{
		return $fieldData;
	}

    protected function ClearText($text)
    {
        return Mozg::Lib('minifier')->MinifyHTML(Mozg::Lib('purifier')->purifyHTML($text));
    }

    public function GetField($fieldId, $fieldName, $value = null, $params = array(), $error = false)
    {
        $this->params = $params;
		$this->data = $this->PrepareOut($value, $params);

    	$this->fieldId = $fieldId;
    	$this->fieldName = $fieldName;

    	$this->error = $error;

    	return $this->RenderField();
    }

    protected function RenderField()
    {
    	throw new Mozg_Exception_System('Field should be extended');
    }

}